const express = require('express')
const userCtrl = require('../controller/user')
const router = express.Router()
const userValidator = require('../validator/user')
// const auth = require('../middleware/auth')


// 用户登录
router.post('/login', userValidator.login,userCtrl.login)

// 用户注册
router.post('/register',userValidator.register,  userCtrl.register)

// 获取当前登录用户
router.get('/:name', userCtrl.getCurrentUser)
module.exports = router